import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
        hasLogin: false,
        userinfo: ""
    },
    mutations: {
        login(state) {
            state.hasLogin = true;
        },
        setUserInfo(state,data) {
			state.userinfo = {
				id:data.id,
				avatarUrl: data.headimgurl
			};
			state.hasLogin = true;
        }
    }
})
export default store
